(insert-buffer-substring "*scratch*" 1 40)
(get-buffer-create "foo")

(set-buffer "foo")
(current-buffer)

(defun insert-string-to-buffer
  (buffer-name str start end))
(length "abc")

(defun test()
  (message (buffer-name (current-buffer))))

(test)

(defun test1()
  (set-buffer "foo")
  (insert "abc" 3))
(test1)

(defun buffer-exist (b-name)
  (dolist (buf (list-buffers))
    (catch 'break
      (when (string-equal b-name (buffer-name buf))
	(throw 'break t)))))
(buffer-exist "foo")
